package cn.jackyu.stock.stock_grid_trading.event.producer;

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class AppStartupRunner implements CommandLineRunner {

    private final StockService stockService;

    public AppStartupRunner(StockService stockService) {
        this.stockService = stockService;
    }

    @Override
    public void run(String... args) throws Exception {
        // 启动订阅
        stockService.startSubscription();
    }
}